{ "nodes": [ { "datums": [ { "expr": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "18", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "75", "name": "r", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXqYf75a-f0Z-Zf18',float('-75.000000'),float('-75.000000'),float('0.000000'),float('75.000000'),float('75.000000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -317, -357 ], "name": "c0", "script": [ "import fab", "import math", "", "title('Cylinder (Z)')", "", "input('x', float)", "input('y', float)", "input('zmin', float)", "input('zmax', float)", "input('r', float)", "", "output('shape', fab.shapes.cylinder(x, y, zmin, zmax, r))", "", "# UI", "sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])", "sb.ui.wireframe([(x, y, zmin), (x+r, y, zmin)])", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmin)", " for i in range(36)], close=True)", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmax)", " for i in range(36)], close=True)", "", "sb.ui.point(x, y, zmin)", "sb.ui.point(x, y, zmax)", "sb.ui.point(x + r, y, zmin, drag=(r, None, None))", "" ], "uid": 0 }, { "datums": [ { "expr": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "0.0", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "18", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "65", "name": "r", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXqYf65a-f0Z-Zf18',float('-65.000000'),float('-65.000000'),float('0.000000'),float('65.000000'),float('65.000000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ -300, -68 ], "name": "c1", "script": [ "import fab", "import math", "", "title('Cylinder (Z)')", "", "input('x', float)", "input('y', float)", "input('zmin', float)", "input('zmax', float)", "input('r', float)", "", "output('shape', fab.shapes.cylinder(x, y, zmin, zmax, r))", "", "# UI", "sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])", "sb.ui.wireframe([(x, y, zmin), (x+r, y, zmin)])", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmin)", " for i in range(36)], close=True)", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmax)", " for i in range(36)], close=True)", "", "sb.ui.point(x, y, zmin)", "sb.ui.point(x, y, zmax)", "sb.ui.point(x + r, y, zmin, drag=(r, None, None))", "" ], "uid": 1 }, { "datums": [ { "expr": "\u0011[__0.__5]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__1.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aam__f1-r+qXqYf75a-f0Z-Zf18nam__f1-r+qXqYf65a-f0Z-Zf18',float('-75.000000'),float('-75.000000'),float('0.000000'),float('75.000000'),float('75.000000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 39, -202 ], "name": "d0", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 2 }, { "datums": [ { "expr": "0.0", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "14", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "18", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "67.5", "name": "r", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+qXqYf67.5a-f14Z-Zf18',float('-67.500000'),float('-67.500000'),float('14.000000'),float('67.500000'),float('67.500000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 48, -23 ], "name": "c2", "script": [ "import fab", "import math", "", "title('Cylinder (Z)')", "", "input('x', float)", "input('y', float)", "input('zmin', float)", "input('zmax', float)", "input('r', float)", "", "output('shape', fab.shapes.cylinder(x, y, zmin, zmax, r))", "", "# UI", "sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])", "sb.ui.wireframe([(x, y, zmin), (x+r, y, zmin)])", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmin)", " for i in range(36)], close=True)", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmax)", " for i in range(36)], close=True)", "", "sb.ui.point(x, y, zmin)", "sb.ui.point(x, y, zmax)", "sb.ui.point(x + r, y, zmin, drag=(r, None, None))", "" ], "uid": 3 }, { "datums": [ { "expr": "\u0011[__2.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__3.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaam__f1-r+qXqYf75a-f0Z-Zf18nam__f1-r+qXqYf65a-f0Z-Zf18nam__f1-r+qXqYf67.5a-f14Z-Zf18',float('-75.000000'),float('-75.000000'),float('0.000000'),float('75.000000'),float('75.000000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 366, -207 ], "name": "d1", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 4 }, { "datums": [ { "expr": "-75+5", "name": "x", "type": "float", "uid": 0 }, { "expr": "0.0", "name": "y", "type": "float", "uid": 1 }, { "expr": "18-3.175", "name": "zmin", "type": "float", "uid": 2 }, { "expr": "\u0011[__6.__0]", "name": "zmax", "type": "float", "uid": 3 }, { "expr": "\u0011[__6.__1]", "name": "r", "type": "float", "uid": 4 }, { "expr": "\u0012fab.types.Shape('am__f1-r+q-Xf-70qYf3.175a-f14.825Z-Zf18',float('-73.175003'),float('-3.175000'),float('14.825000'),float('-66.824997'),float('3.175000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 5 } ], "inspector": [ 398.57500857629071, 3.4997669738545909 ], "name": "c3", "script": [ "import fab", "import math", "", "title('Cylinder (Z)')", "", "input('x', float)", "input('y', float)", "input('zmin', float)", "input('zmax', float)", "input('r', float)", "", "output('shape', fab.shapes.cylinder(x, y, zmin, zmax, r))", "", "# UI", "sb.ui.wireframe([(x, y, zmin), (x, y, zmax)])", "sb.ui.wireframe([(x, y, zmin), (x+r, y, zmin)])", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmin)", " for i in range(36)], close=True)", "", "sb.ui.wireframe([", " (math.cos(i/36. * 2*math.pi) * r + x,", " math.sin(i/36. * 2*math.pi) * r + y, zmax)", " for i in range(36)], close=True)", "", "sb.ui.point(x, y, zmin)", "sb.ui.point(x, y, zmax)", "sb.ui.point(x + r, y, zmin, drag=(r, None, None))", "" ], "uid": 5 }, { "datums": [ { "expr": "18", "name": "x", "type": "float", "uid": 0 }, { "expr": "6.35/2", "name": "y", "type": "float", "uid": 1 } ], "inspector": [ 89.066910660026224, 263.81844423349554 ], "name": "p0", "script": [ "import fab", "", "title('Point (2D)')", "", "input('x', float)", "input('y', float)", "", "sb.ui.point(x, y, 0)", "" ], "uid": 6 }, { "datums": [ { "expr": "\u0011[__4.__2]", "name": "a", "type": "_fabtypes.Shape", "uid": 0 }, { "expr": "\u0011[__5.__5]", "name": "b", "type": "_fabtypes.Shape", "uid": 1 }, { "expr": "\u0012fab.types.Shape('aaaam__f1-r+qXqYf75a-f0Z-Zf18nam__f1-r+qXqYf65a-f0Z-Zf18nam__f1-r+qXqYf67.5a-f14Z-Zf18nam__f1-r+q-Xf-70qYf3.175a-f14.825Z-Zf18',float('-75.000000'),float('-75.000000'),float('0.000000'),float('75.000000'),float('75.000000'),float('18.000000'))", "name": "shape", "type": "_fabtypes.Shape", "uid": 2 } ], "inspector": [ 683.22212480982159, -167.98695808030266 ], "name": "d2", "script": [ "import fab.types", "", "title('Difference')", "input('a', fab.types.Shape)", "input('b', fab.types.Shape)", "", "output('shape', a & ~b)", "" ], "uid": 7 } ], "protocol": 6, "type": "sb" }